package cn.edu.zafu.bigdata.x.wgj.e;
import java.util.HashMap;
class StudentGradeManager {
    private HashMap<String,Integer> studentGrades;
    public StudentGradeManager(){
        studentGrades=new HashMap<>();
    }
    public void addStudent(String name,int grade){
        studentGrades.put(name,grade);
    }
    public int getGrade(String name){
        if(studentGrades.containsKey(name)){
            return studentGrades.get(name);
        }
        return -1;
    }
    public void removeStudent(String name){
        if(studentGrades.containsKey(name)){
            studentGrades.remove(name);
        }
    }
}
public class StudentGradeManagerTest{
    public static void main(String[] args){
        StudentGradeManager manager =new StudentGradeManager();
        manager.addStudent("张三",85);
        manager.addStudent("李四",90);
        manager.addStudent("王五",78);
        System.out.println("张三的成绩："+manager.getGrade("张三"));
        System.out.println("李四的成绩："+manager.getGrade("李四"));
        System.out.println("王五的成绩："+manager.getGrade("王五"));
        System.out.println("赵六的成绩："+manager.getGrade("赵六"));
        manager.removeStudent("王五");
        System.out.println("删除王五的成绩后，王五的成绩："+manager.getGrade("王五"));
    }
}